package com.zlsx.textstartservice;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

/**
 * 测试启动悬浮窗功能model
 */
public class MainActivity extends AppCompatActivity {
    private Button bt_startService;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        bt_startService=findViewById(R.id.start_service);
        bt_startService.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setComponent(new ComponentName("com.zlsx.flowview", "com.zlsx.flowview.FloatViewService"));
                startService(intent);
            }
        });
    }
}
